<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Body 中的 JavaScript</title>
</head>
<body>
<p id="demo">一个段落</p>

<button type="button" onclick="myFunction()">试一试</button>

<script>
  function myFunction(){
    document.getElementById("demo").innerHTML="段落已被更改";
  }
</script>

</body>
</html>